package com.edais.domain.gift;

import java.util.Date;

public class PointFlow {
    private Long id;

    private Long userId;

    private String userName;

    private String userMobile;

    private Integer amount;

    private String flowType;

    private String intro;

    private Long orderId;

    private String concurrentId;

    private Long productOrderId;

    private Long productId;

    private String productName;

    private Long ruleId;

    private String ruleName;

    private String createPer;

    private Date createTime;

    private String updatePer;

    private Date updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getUserMobile() {
        return userMobile;
    }

    public void setUserMobile(String userMobile) {
        this.userMobile = userMobile == null ? null : userMobile.trim();
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public String getFlowType() {
        return flowType;
    }

    public void setFlowType(String flowType) {
        this.flowType = flowType == null ? null : flowType.trim();
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro == null ? null : intro.trim();
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getConcurrentId() {
        return concurrentId;
    }

    public void setConcurrentId(String concurrentId) {
        this.concurrentId = concurrentId == null ? null : concurrentId.trim();
    }

    public Long getProductOrderId() {
        return productOrderId;
    }

    public void setProductOrderId(Long productOrderId) {
        this.productOrderId = productOrderId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getRuleId() {
        return ruleId;
    }

    public void setRuleId(Long ruleId) {
        this.ruleId = ruleId;
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public String getCreatePer() {
        return createPer;
    }

    public void setCreatePer(String createPer) {
        this.createPer = createPer;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdatePer() {
        return updatePer;
    }

    public void setUpdatePer(String updatePer) {
        this.updatePer = updatePer;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public PointFlow() {
    }

    public PointFlow(PointAccount account ,PointOrder pointOrder ,GiftPackageGiftOrder order){
        this.userId = account.getUserId();
        this.userName = account.getUserName();
        this.userMobile = account.getUserMobile();
        this.orderId = pointOrder.getId();
        this.ruleId = order.getPackageGiftId();
        this.ruleName = order.getGiftName();
        //组合并发ID
        this.concurrentId = this.concurrentId(order);
    }

    private String concurrentId(GiftPackageGiftOrder order){
        if(null == order) return null;
        return order.getId() + "_" + order.getPackageId() + "_" + order.getGiftId() + "_" + this.userId;
    }
}